<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/8/20
 * Time: 4:11
 */
namespace app\models;
use Yii;
use yii\db\ActiveRecord;

class Article extends ActiveRecord {

    public $id;
    public $type;
    public $title;
    public $context;
    public $time;
    public $readtimes;

    public static function tableName()
    {
        return 'article';
    }

    public function rules()
    {
        return [[["type","title","context","time"],"required",],];

    }
    public function scenarios()
    {
        return [
            'addarticle' => ['title', 'type','context'],
            'updatearticle' => ['id','title', 'type','context'],
        ];
    }





}